package com.yue.yadmin.enums;
/**
 * 字典代码   menu-icon:菜单icon 
 * 廖欣跃
 * Fri Aug 31 18:25:59 CST 2018
 */
public enum EnumDictCode {
	/**
	 *["menu-icon","菜单icon"]
	 */
	MENU_ICON("menu-icon","菜单icon");
	private String code;
	private String desc;
	public void setCode(String code){
		this.code=code;
	}
	public String getCode(){
		return code;
	}
	public void setDesc(String desc){
		this.desc=desc;
	}
	public String getDesc(){
		return desc;
	}
	private EnumDictCode(String code,String desc){
		this.code=code;
		this.desc=desc;
	}
	/**
	 * 查找枚举,不存在返回null
	 */
	public static EnumDictCode getEnum(String code,String desc){
		for(EnumDictCode e:values()){
			if((code!=null&&e.getCode().equals(code))||(desc!=null&&e.getDesc().equals(desc))){
				return e;
			}
		}
		return null;
	}
}
